package com.mzj.saas.commons.pdf;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

/**
 * 当java调用wkhtmltopdf时，用于获取wkhtmltopdf返回的内容
 */
public class HtmlToPdfInterceptor extends Thread {
 
    private static final Logger LOG = LoggerFactory
            .getLogger(HtmlToPdfInterceptor.class);
 
    private InputStream is;
 
    public HtmlToPdfInterceptor(InputStream is) {
        this.is = is;
    }
 
    public void run() {
        try {
            InputStreamReader isr = new InputStreamReader(is, "utf-8");
            BufferedReader br = new BufferedReader(isr);
            br.readLine();
        } catch (IOException e) {
            LOG.error(e.getMessage());
            e.printStackTrace();
        }
    }
}
